package com.jz.community.moduleshopping.confirmOrder.net;

import com.jz.community.basecomm.constant.Constant;
import com.jz.community.moduleshopping.confirmOrder.bean.BaseOrderCouponInfo;
import com.jz.community.moduleshopping.confirmOrder.bean.OrderCouponInfo;
import com.jz.community.moduleshopping.confirmOrder.bean.OrderPayResultBean;
import com.jz.community.moduleshopping.confirmOrder.bean.OrderPostageInfo;
import com.jz.community.moduleshopping.confirmOrder.bean.SubmitOrderResultBean;
import com.jz.community.moduleshopping.goodsDetail.bean.GoodsCouponInfo;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.PATCH;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Created by Tony.Fan on 2018/4/4 11:09
 */
public interface ConfirmOrderApi {

    @POST(Constant.ORDER_URL)
    Observable<SubmitOrderResultBean> submitOrder(@Body RequestBody body);

    @POST(Constant.ORDER_POSTAGE)
    Observable<OrderPostageInfo> orderPostage(@Body RequestBody body);

    @PATCH(Constant.ORDER_PAY_URL + "/{id}")
    Observable<OrderPayResultBean> orderPay(@Path("id") String id, @Query("payType") String payType);


    @POST(Constant.ORDER_NEW_COUPON_URL)
    Observable<OrderCouponInfo> getOrderPlatformAndShopCouponInfo(@Body RequestBody body,
                                                                  @Query("appCode") String appCode);

    @POST(Constant.ORDER_PLATFORM_NEW_COUPON_URL)
    Observable<List<BaseOrderCouponInfo>> getOrderPlatformCouponInfo(@Body RequestBody body,
                                                                    @Query("appCode") String appCode);

    @PUT(Constant.UPDATE_ORDER_NEW_COUPON_URL)
    Observable<GoodsCouponInfo> getUpdateOrderCouponInfo(@Body RequestBody body);

}
